#include <bits/stdc++.h>
using namespace std;


bool check(int numerator,int dominator){
   set<int> n,d,res;
  if (numerator==1||dominator == 1) return true;
  if (numerator==dominator) return false;
  
  for(int i=1;i<=sqrt(numerator);i++){
    if (i*(numerator/i)==numerator){
      n.insert(i);
      n.insert(numerator/i);
    }
  }

   for(int i=1;i<=sqrt(dominator);i++){
    if (i*(dominator/i)==dominator){
      d.insert(i);
      d.insert(dominator/i);
    }
  }

  set_intersection(n.begin(),n.end(),d.begin(),d.end(),inserter( res , res.begin() ));
  if (res.size()==1) return true;
  else return false;

}
int main() {
  int sum = 0;
  for(int nor = 1;nor<=2020;nor++ )
  for(int dor = 1;dor<=2020;dor++){
    if (check(nor,dor)) sum++;
  }
  cout<<sum;
  return 0;
}

//cout<<2481215;